Reject implementing const Drop for types that are not const Destruct already#155676
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Apr 26, 2026
Merged
Conversation
Collaborator
|
|
fee1-dead
requested changes
Apr 25, 2026
| impl_def_id: LocalDefId, | ||
| adt_def_id: DefId, | ||
| ) -> Result<(), ErrorGuaranteed> { | ||
| if tcx.is_conditionally_const(impl_def_id) { |
Member
There was a problem hiding this comment.
Suggested change
| if tcx.is_conditionally_const(impl_def_id) { | |
| if !tcx.is_conditionally_const(impl_def_id) { | |
| return Ok(()); | |
| } |
Then the big ocx.evaluate_obligations_error_on_ambiguity() can just be trailing.
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
ad87dce to
7dcedaf
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Contributor
Author
|
@bors r=fee1-dead rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 25, 2026
…uct, r=fee1-dead Reject implementing const Drop for types that are not const `Destruct` already fixes rust-lang#155618 While there is no soundness or otherwise issue currently, this PR ensures that people get what they expect. It seems wrong to allow implementing `const Drop`, but then the type still can't be dropped at compile-time. r? @fee1-dead
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 25, 2026
…uct, r=fee1-dead Reject implementing const Drop for types that are not const `Destruct` already fixes rust-lang#155618 While there is no soundness or otherwise issue currently, this PR ensures that people get what they expect. It seems wrong to allow implementing `const Drop`, but then the type still can't be dropped at compile-time. r? @fee1-dead
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 25, 2026
…uwer Rollup of 4 pull requests Successful merges: - #146181 (Add intrinsic for launch-sized workgroup memory on GPUs) - #155065 (Error on invalid macho section specifier) - #155676 ( Reject implementing const Drop for types that are not const `Destruct` already) - #155783 (Do not suggest internal cfg trace attributes)
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 25, 2026
…uwer Rollup of 9 pull requests Successful merges: - #146181 (Add intrinsic for launch-sized workgroup memory on GPUs) - #154803 (Fix ICE from cfg_attr_trace ) - #155065 (Error on invalid macho section specifier) - #155485 (Add an edge-case test for `--remap-path-prefix` for `rustc` & `rustdoc`) - #155659 (cleanup, restructure and merge `tests/ui/deriving` into `tests/ui/derives`) - #155676 ( Reject implementing const Drop for types that are not const `Destruct` already) - #155696 (Add a higher-level API for parsing attributes) - #155769 (triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes) - #155783 (Do not suggest internal cfg trace attributes)
rust-timer
added a commit
that referenced
this pull request
Apr 26, 2026
Rollup merge of #155676 - oli-obk:const-drop-non-const-destruct, r=fee1-dead Reject implementing const Drop for types that are not const `Destruct` already fixes #155618 While there is no soundness or otherwise issue currently, this PR ensures that people get what they expect. It seems wrong to allow implementing `const Drop`, but then the type still can't be dropped at compile-time. r? @fee1-dead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #155618
While there is no soundness or otherwise issue currently, this PR ensures that people get what they expect. It seems wrong to allow implementing
const Drop, but then the type still can't be dropped at compile-time.r? @fee1-dead